//package com.niiwoo.civet.trade.service.dubbo.loan.core;
//
//import com.alibaba.fastjson.JSON;
//import com.niiwoo.asset.huijie.constant.HuijieMqConstants;
//import com.niiwoo.asset.huijie.dto.mq.HuijieOrderStatusChangedDTO;
//import com.niiwoo.asset.huijie.enums.HuijieOrderProjectSubStatusEnum;
//import com.niiwoo.asset.huijie.enums.HuijieOrderStatusEnum;
//import com.niiwoo.civet.trade.dao.entity.Project;
//import com.niiwoo.civet.trade.dao.mapper.ProjectMapper;
//import com.niiwoo.civet.trade.dto.request.loan.PushProjectRequestDTO;
//import com.niiwoo.civet.trade.enums.ProjectFromSourceEnum;
//import com.niiwoo.civet.trade.enums.ProjectStatusEnum;
//import com.niiwoo.civet.trade.enums.ProjectSubStatusEnum;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.util.Date;
//
///**
// * @Description:汇介推标
// * @Author:daizhiyue
// * @Date:2018/05/22
// */
//@Slf4j
//@Service
//public class HuijieSpeedLoanServiceImpl extends AbstractSpeedLoan {
//
//    @Autowired
//    private RabbitTemplate rabbitTemplate;
//    @Autowired
//    private ProjectMapper projectMapper;
//
//    @Override
//    protected void sendInstationInfo(Project project) {
//        log.info("汇介-推标-不需要发站内信息：projectId={}", project.getProjectId());
//    }
//
//    @Override
//    protected void pushProjectSuccess(PushProjectRequestDTO pushProjectRequestDTO, Project project) {
//        super.pushProjectSuccess(pushProjectRequestDTO, project);
//        this.sendMQForNotify(project);
//    }
//
//
//    private void sendMQForNotify(Project project) {
//        Project projectRes = projectMapper.selectByPrimaryKey(project.getProjectId());
//        try {
//            if ((projectRes.getStatus().equals(ProjectStatusEnum.COLLECTING.getStatus().byteValue()) &&
//                    projectRes.getSubStatus().equals(ProjectSubStatusEnum.COLLECTING_INIT.getSubStatus()))) {
//                HuijieOrderStatusChangedDTO huijieOrderStatusChangedDTO = new HuijieOrderStatusChangedDTO();
//                huijieOrderStatusChangedDTO.setProjectId(projectRes.getProjectId());
//                huijieOrderStatusChangedDTO.setHuijieOrderProjectSubStatusEnum(HuijieOrderProjectSubStatusEnum.COLLECTING_INIT);
//                huijieOrderStatusChangedDTO.setHuijieOrderStatusEnum(HuijieOrderStatusEnum.COLLECTING);
//                huijieOrderStatusChangedDTO.setReason("推标至存管成功通知");
//                huijieOrderStatusChangedDTO.setUpdateDate(new Date());
//                log.info("send huijie_order_status_nofify huijieOrderStatusChangedDTO:{}", JSON.toJSON(huijieOrderStatusChangedDTO));
//                rabbitTemplate.convertAndSend(HuijieMqConstants.Exchange.ASSET_HUIJIE_EXCHANGE,
//                        HuijieMqConstants.getRoutingKey(HuijieMqConstants.Exchange.ASSET_HUIJIE_EXCHANGE, HuijieMqConstants.Queue.ORDER_STATUS_NOFIFY_QUEUE), huijieOrderStatusChangedDTO);
//            }
//        } catch (Throwable e) {
//            log.error("汇介推标-发送订单状态反馈mq发送异常，send huijie_order_status_nofify projectId:{}", projectRes.getProjectId(), e);
//        }
//    }
//}
